<?php

namespace Fuel\Migrations;

class Create_auditoriums
{
	public function up()
	{
		\DBUtil::create_table('auditoriums', array(
			'id' => array('constraint' => 11, 'type' => 'int', 'auto_increment' => true),
			'auditorium_name' => array('constraint' => 100, 'type' => 'varchar'),
			'rows' => array('type' => 'smallint'),
			'seats_per_row' => array('type' => 'smallint'),
			'support_3d' => array('type' => 'tinyint')
		), array('id'));
                
                $auditorium0 = \Model_Orm_Auditorium::forge();
                $auditorium0->id = 0;
                $auditorium0->auditorium_name = 'ATCELTS / CANCELLED';
                $auditorium0->rows = 40;
                $auditorium0->seats_per_row = 50;
                $auditorium0->support_3d = 1;
                $auditorium0->save();
                
                $auditorium1 = \Model_Orm_Auditorium::forge();
                $auditorium1->auditorium_name = '1. auditorija';
                $auditorium1->rows = 5;
                $auditorium1->seats_per_row = 10;
                $auditorium1->support_3d = 0;
                $auditorium1->save();
                
                $auditorium2 = \Model_Orm_Auditorium::forge();
                $auditorium2->auditorium_name = '2. auditorija';
                $auditorium2->rows = 10;
                $auditorium2->seats_per_row = 15;
                $auditorium2->support_3d = 1;
                $auditorium2->save();
                
                $auditorium3 = \Model_Orm_Auditorium::forge();
                $auditorium3->auditorium_name = '3. bērnu filmu auditorija';
                $auditorium3->rows = 7;
                $auditorium3->seats_per_row = 10;
                $auditorium3->support_3d = 1;
                $auditorium3->save();
	}

	public function down()
	{
		\DBUtil::drop_table('auditoriums');
	}
}